package com.iplant.basic.serviceImpl.dao.mss;

import com.iplant.base.po.OutResult;
import com.iplant.base.po.Pagination;
import com.iplant.base.utils.annotation.dao.DBBaseDAO;
import com.iplant.base.utils.sql.BaseDAO;
import com.iplant.basic.service.po.bms.BMSEmployee;
import com.iplant.basic.service.po.mss.MSSMaterial;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

@DBBaseDAO(MSSMaterial.class)
public class MSSMaterialDAO extends BaseDAO {

    private static Logger logger = LoggerFactory.getLogger(MSSMaterialDAO.class);
    private static MSSMaterialDAO Instance = null;

    private MSSMaterialDAO() {
        super("");
        this.Init();
    }

    public static MSSMaterialDAO getInstance() {
        if (Instance == null) {
            synchronized (MSSMaterialDAO.class) {
                if (Instance == null) {
                    Instance = new MSSMaterialDAO();
                }
            }

        }
        return Instance;
    }




    public List<MSSMaterial> MSS_QueryMaterialList(BMSEmployee wLoginUser, String wMaterialNoLike,
                                                   String wMaterialNameLike, int wMaterialTypeID, int wMaterialGroupID, int wTypeID,
                                                   String wMaterialFullGroup, String wMaterialMode, String wDrawingNoLike, int wRecoil,
                                                   int wOutsourced, int wActive, Pagination wPagination, OutResult<Integer> wErrorCode) {


        Map<String, Object> wParams = new HashMap<>();
        wParams.put("Code", wMaterialNoLike);
        wParams.put("MaterialName", wMaterialNameLike);
        wParams.put("MaterialTypeID", wMaterialTypeID);
        wParams.put("MaterialGroupID", wMaterialGroupID);
        wParams.put("TypeID", wTypeID);
        wParams.put("MaterialFullGroup", wMaterialFullGroup);
        wParams.put("MaterialMode", wMaterialMode);
        wParams.put("DrawingNo", wDrawingNoLike);
        wParams.put("Recoil", wRecoil);
        wParams.put("Outsourced", wOutsourced);
        wParams.put("Active", wActive);

        return this.SelectPOList(wLoginUser, wParams, wPagination, wErrorCode);
    }


}
